<?php

namespace App\Model;

class UsersModel extends BaseModel
{

    protected $table = 'users';

    protected $primaryKey = 'user_id';

    protected $fillable = ['openid','nickname','username','user_phone','password','share_code','spread_id','status'];




    public function spreadInfo(): \Illuminate\Database\Eloquent\Relations\HasOne
    {
        return $this->hasOne(UsersModel::class,'user_id','spread_id');

    }
    public function pointInfo(): \Illuminate\Database\Eloquent\Relations\HasOne
    {
        return $this->hasOne(UsersModel::class,'user_id','point_uid');
    }

    public function shopInfo(): \Illuminate\Database\Eloquent\Relations\HasOne
    {
        return $this->hasOne(ShopModel::class,'user_id','user_id');
    }

}
